VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "TestCompositeMethod"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

Private mComposite As CompositeMethodCaller
Private mCount As Integer
Private mRequest As Integer
Private mNotify As New MockNotifier

Public Sub testOneCall()
doCompositeTest 1
End Sub
Public Sub testTwoCalls()
doCompositeTest 2
End Sub

''
''
Private Sub doCompositeTest(times As Integer)
givenCompositeMethod times
whenCalled
thenCountMatchesRequest
End Sub

Private Sub givenCompositeMethod(request As Integer)
Dim I As Integer
mRequest = request
Set mComposite = New CompositeMethodCaller
mComposite.init
For I = 1 To request
    mComposite.Add Me
Next
End Sub

Private Sub whenCalled()
mComposite.forward mNotify
End Sub

Private Sub thenCountMatchesRequest()
assert.equals mCount, mRequest, "Counted calls matches request"
'assert.equals 1, 2, "error"
End Sub
''
''


Public Sub setup()
mCount = 0
'mRequest = 1 / mCount
End Sub
Public Function NumOfAsserts() As Long
NumOfAsserts = 2
End Function



'Public method available to be called by a Composite
Public Sub forward(notify As Object)
mCount = mCount + 1
End Sub

